package com.weixing.mall.provider.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.weixing.mall.base.orm.MPage;
import com.weixing.mall.provider.api.model.dto.MemberAgentBindDto;
import com.weixing.mall.provider.api.model.vo.AgentMemberVo;
import com.weixing.mall.provider.api.model.vo.MemberRpcVo;
import com.weixing.mall.provider.model.domain.Member;
import com.weixing.mall.provider.model.dto.BinCustomerDto;
import com.weixing.mall.provider.model.dto.MemberDto;
import com.weixing.mall.provider.model.dto.MemberLocDto;
import com.weixing.mall.provider.model.dto.RegisterDto;
import com.weixing.mall.provider.model.query.MemberBindQuery;
import com.weixing.mall.provider.model.query.MemberQuery;
import com.weixing.mall.provider.model.vo.MemberBindVo;
import com.weixing.mall.provider.model.vo.MemberIndexVo;
import com.weixing.mall.provider.model.vo.MemberListVo;
import com.weixing.mall.provider.model.vo.MemberVo;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 会员模块-会员表 服务类
 * </p>
 *
 * @author Small
 * @since 2019-11-13
 */
public interface IMemberService extends IService<Member> {

    Member selectByMobile(String mobile);

    boolean checkMobileExist(String mobile);

    void register(RegisterDto registerDto, Long agentId);

    void resetPwd(String mobile, String password);

    MemberVo selectDetail(long id);

    void updateAvator(String avator, Long mid);

    void updateBirthDay(String birthDay, Long mid);

    void updateGender(int gender, Long mid);

    void updateMobile(String mobile, Long mid);

    void updateProvincesPath(MemberLocDto memberProvincesPathDto, Long mid);

    void updatePassword(Long id, String newPwd);

    IPage<MemberListVo> selectListOfPage(Page page, MemberQuery memberQuery);

    void create(MemberDto memberDto);


    MPage<AgentMemberVo> selectAgentMemberOfPage(MPage page, long agentId);

    void bindCustomer(BinCustomerDto binCustomerDto);

    IPage<MemberBindVo> memberBindlist(Page page, MemberBindQuery memberBindQuery);

    MemberRpcVo selectByIdMemberRpcVo(Long id);

    MemberIndexVo selectMemberIndex(Long mid);

    void bindDel(Long id);


    Member selectByOpenId(String openId);


    void unBindAgent(Long mid);

    void saveOrUpdateMember(MemberAgentBindDto bindDto);

    void changAgentStatus(long  agentId);

    void handlerPoint(Long memberId, Integer point, Integer inOrOut,String desp);

    boolean handlerPoint(Long memberId, Long point, Integer inOrOut,String desp,Long operatorId);

    void bonusPointsHandle(Long memberId, String code, BigDecimal amount, Long operatorId);

    Member loadUserByXcxOpenId(String openId);

    void register(String openId, String mobile);

    void updateCid(String cid, Long mid);

    List<String> loadAgentCid(String[] agentIds);

    String loadAgentCid(Long agentId);
}
